using UnityEngine;

public class hitinfoUI : MonoBehaviour
{
	private GameObject uiobj;

	public TweenAlpha planeanima;

	public UILabel hitinfolabel;

	private bool isshow;

	public void enable(hitinfoid curinfo, string name)
	{
		if (uiobj == null)
		{
			uiobj = base.gameObject;
		}
		if (!isshow)
		{
			isshow = true;
			switch (curinfo)
			{
				case hitinfoid.rank:
					hitinfolabel.text = "所需军衔 \"" + name + "\"";
					break;
				case hitinfoid.battlelock:
					hitinfolabel.text = "请完成前面的关卡";
					break;
				case hitinfoid.battlestar:
					hitinfolabel.text = "获得的星星数量不足";
					break;
				case hitinfoid.levellock:
					hitinfolabel.text = "请完成前面的关卡";
					break;
				case hitinfoid.challengetimes:
					hitinfolabel.text = "请稍候，你没有体力";
					break;
				case hitinfoid.challengelevel:
					hitinfolabel.text = "在战斗模式中通过所需关卡以解锁";
					break;
				case hitinfoid.garageweapon:
					hitinfolabel.text = "\"" + name + "\" 可以装备在战斗机上";
					break;
				case hitinfoid.boxnull:
					hitinfolabel.text = "请购买一个盒子";
					break;
				case hitinfoid.box_star:
					hitinfolabel.text = "星星数量不足！";
					break;
				case hitinfoid.box_claim:
					hitinfolabel.text = "你已获得奖励";
					break;
				case hitinfoid.ship_click:
					hitinfolabel.text = "你找到了我！";
					break;
				case hitinfoid.customisation:
					hitinfolabel.text = name;
					break;
			}
			//hitinfolabel.text = "asasddadsadadsadsad";
			NGUITools.SetActive(uiobj, state: true);
			MenuBackController.instance.ChangeMenuUIstate(MenuUIState.hitinfoui);
			planeanima.PlayForward();
			Invoke("oneslater", 1f);
		}
	}

	public void oneslater()
	{
		planeanima.PlayReverse();
		Invoke("disable", 0.6f);
	}

	public void disable()
	{
		if (!UnityVersionUtil.IsActive(uiobj))
		{
			NGUITools.SetActive(uiobj, state: false);
			MenuBackController.instance.BackMenuUIstate();
			isshow = false;
		}
	}
}
